import Vue from 'vue'
import Router from 'vue-router'
import Guest from '@/components/Guest'
import Index from '@/components/Index'
import Room from '@/components/Room'
import RoomType from '@/components/RoomType'
import Staff from '@/components/Staff'
import Login from '@/components/Login'
import Dept from '@/components/Dept'
import Permission from '@/components/Permission'
import Role from '@/components/Role'
import Vip from '@/components/Vip'
import Checkin from '@/components/Checkin'
import Position from '@/components/Position'
import Roomfix from '@/components/Roomfix'
import Revenue from '@/components/Revenue'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',//给当前路由起了个名称，自己起
      component: Login//名称和import关键后的名称保持一致
    },
    {
      path:'/Index',
      name: 'Index',
      component:Index,
      meta:{
        requireAuth:true,//表示该组件需要登录
        
      },
      children:[
        {
          path:"/Room",
          name:"Room",
          component:Room,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:"/RoomType",
          name:"RoomType",
          component:RoomType,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path: '/Dept',
          name: 'Dept',
          component: Dept,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:"/Permission/:rid",
          name:"Permission",
          component:Permission,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:"/Role",
          name:"Role",
          component:Role,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:'/Guest',
          name: 'Guest',
          component: Guest,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:'/Staff',
          name: 'Staff',
          component: Staff,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:'/Vip',
          name: 'Vip',
          component: Vip,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:'/Checkin/:rid/:rnum/:rcode',
          name: 'Checkin',
          component: Checkin,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
        {
          path:'/Position',
          name:'Position',
          component: Position,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },

        },
        {
          path:'/Revenue',
          name:'Revenue',
          component: Revenue,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },

        },
        {
          path:"/Roomfix",
          name:"Roomfix",
          component:Roomfix,
          meta:{
            requireAuth:true,//表示该组件需要登录
            
          },
        },
      ]
    }
  ]
})
